]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
NetworkMenu/NMDeviceModem: use the operator name when we have it
authorGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 3 Oct 2013 12:49:21 +0000 (14:49 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 9 Oct 2013 16:39:44 +0000 (18:39 +0200)
Instead of the connection name, as the operator name is usually
shorter and more useful.

https://bugzilla.gnome.org/show_bug.cgi?id=709043

js/ui/status/network.js

index 1dffb3a87c4a61b958119ec4aafef4bde4e621ff..10b3d342f850d1b8c4bb449c19cee751c8cd2cc5 100644 (file)
@@ -426,16 +426,7 @@ const NMDeviceModem = new Lang.Class({
             this._mobileDevice = new ModemManager.ModemGsm(device.udi);
 
         if (this._mobileDevice) {
-            this._operatorNameId = this._mobileDevice.connect('notify::operator-name', Lang.bind(this, function() {
-                if (this._operatorItem) {
-                    let name = this._mobileDevice.operator_name;
-                    if (name) {
-                        this._operatorItem.label.text = name;
-                        this._operatorItem.actor.show();
-                    } else
-                        this._operatorItem.actor.hide();
-                }
-            }));
+            this._operatorNameId = this._mobileDevice.connect('notify::operator-name', Lang.bind(this, this._sync));
             this._signalQualityId = this._mobileDevice.connect('notify::signal-quality', Lang.bind(this, function() {
                 this.emit('icon-changed');
             }));
@@ -467,6 +458,9 @@ const NMDeviceModem = new Lang.Class({
             /* Translators: this is for a network device that cannot be activated
                because it's disabled by rfkill (airplane mode) */
             return _("Disabled");
+        else if (this._device.state == NetworkManager.DeviceState.ACTIVATED &&
+                 this._mobileDevice && this._mobileDevice.operator_name)
+            return this._mobileDevice.operator_name;
         else
             return this.parent();
     },